Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
handle no-vmess case
Browse files Browse the repository at this point in the history
  • Loading branch information
Cenmrev committed Jan 5, 2019
1 parent 0a98f1e commit f4ac59f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions V2RayX/ConfigWindow.xib
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<outlet property="networkButton" destination="tMD-b4-w2E" id="MLa-PK-H4t"/>
<outlet property="portField" destination="vAX-58-HRK" id="l6R-dx-TNq"/>
<outlet property="profileTable" destination="fje-9q-W5F" id="qQT-rE-cPV"/>
<outlet property="transportSettingsButton" destination="L0C-0n-d5i" id="t5T-1t-ijY"/>
<outlet property="versionField" destination="yx5-HK-GpF" id="Dpi-oq-T9A"/>
<outlet property="vmessSecurityButton" destination="Dbo-ml-2p8" id="sSo-w3-Yom"/>
<outlet property="window" destination="QvC-M9-y7g" id="DXu-va-1Ry"/>
Expand Down
1 change: 1 addition & 0 deletions V2RayX/ConfigWindowController.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
@property (weak) IBOutlet NSButton *globalTransportButton;
@property (weak) IBOutlet NSPopUpButton *logLevelButton;
@property (weak) IBOutlet NSMenu *importFromJsonMenu;
@property (weak) IBOutlet NSButton *transportSettingsButton;

@property (weak) AppDelegate* appDelegate;
@property (nonatomic) ServerProfile* selectedProfile;
Expand Down
15 changes: 11 additions & 4 deletions V2RayX/ConfigWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ -(void)tableViewSelectionDidChange:(NSNotification *)notification{
}

- (IBAction)chooseNetwork:(NSPopUpButton *)sender {
[self checkTLSforHttp2];
if (_selectedServerIndex >= 0 && _selectedServerIndex < [_profiles count]) {
[self checkTLSforHttp2];
}
}

- (BOOL)checkTLSforHttp2 {
Expand All @@ -140,9 +142,11 @@ - (BOOL)checkTLSforHttp2 {
[httpTlsAlerm addButtonWithTitle:@"Close"];
[httpTlsAlerm addButtonWithTitle:@"Help"];
[httpTlsAlerm setMessageText:@"Both client and server must enable TLS to use HTTP/2 network! Enbale TLS in transport settings. Click \"Help\" if you need more information"];
if ([httpTlsAlerm runModal] == NSAlertSecondButtonReturn) {
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://www.v2ray.com/chapter_02/transport/h2.html#tips"]];
}
[httpTlsAlerm beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode) {
if (returnCode == NSAlertSecondButtonReturn) {
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://www.v2ray.com/chapter_02/transport/h2.html#tips"]];
}
}];
[_networkButton selectItemAtIndex:0];
return NO; // does not pass checking
}
Expand Down Expand Up @@ -269,6 +273,9 @@ - (IBAction)showAdvancedWindow:(NSButton *)sender {


- (IBAction)showTransportSettings:(id)sender {
if ([_profiles count] == 0) {
return;
}
self.transportWindowController = [[TransportWindowController alloc] initWithWindowNibName:@"TransportWindow" parentController:self];
[[self window] beginSheet:self.transportWindowController.window completionHandler:^(NSModalResponse returnCode) {
if (returnCode == NSModalResponseOK) {
Expand Down

0 comments on commit f4ac59f

Please sign in to comment.